package com.itheima.service.db.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.mapper.AnnouncementMapper;
import com.itheima.service.db.AnnouncementService;
import com.itheima.vo.PageBeanVo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class AnnouncementServiceImpl implements AnnouncementService {

    @Autowired
    private AnnouncementMapper announcementMapper;
    //查询公告AnnouncementService
    @Override
    public PageBeanVo messagesAnnouncements(Integer page, Integer pagesize) {
        IPage page1=new Page(page,pagesize);
        page1=announcementMapper.selectPage(page1, null );
        return new PageBeanVo(page,pagesize,page1.getTotal(),page1.getRecords());
    }


}
